package com.solomiao.demo.multi.thread.demo12;

/**
 * @desc 演示线程的资源共享
 * */
public class MainDemo12 {

    public static void main(String[] args) throws InterruptedException {
        RunnableDemo12 runnableDemo12 = new RunnableDemo12(10);
        Thread t1 = new Thread(runnableDemo12);
        Thread t2 = new Thread(runnableDemo12);
        Thread t3 = new Thread(runnableDemo12);
        t1.start();
        t2.start();
        t3.start();

        t1.join();
        t2.join();
        t3.join();
        System.out.println("卖票结束，当前票数：" + runnableDemo12.getTicket());
    }

}
